package com.tongji.housediy.controller.houseCMD
{
	import com.tongji.housediy.events.GetHouseByIDEvent;
	import com.tongji.housediy.model.HouseModel;
	import com.tongji.housediy.service.HouseService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/08/
	 */ 
	public class GetHouseByIDCommand extends Command
	{
		[Inject]
		public var service:HouseService;
		
		[Inject]
		public var model:HouseModel;
		
		[Inject]
		public var event:GetHouseByIDEvent;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case GetHouseByIDEvent.GET_HOUSE_BY_ID:
					service.getHouseByID(event.houseID);
					break;
				case GetHouseByIDEvent.UPDATE_HOUSE_DETAIL:
					model.updateHouseDetail(event.houseDetail);
					break;
			}
		}
	}
}